<%@page import="org.joda.time.LocalDate"%>
<%@page import="java.sql.Timestamp"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
	
<%@page import="java.text.DateFormat" %>
<%@page import="java.text.SimpleDateFormat" %>
<%@page import="java.util.Date"%>
<%@page import="java.util.List"%>
<%@page import="com.easyattendance.model.AssignmentStudent"%>
<%@ page import ="com.easyattendance.services.AddTeacherService" %>
<%@ page import ="com.easyattendance.model.Teacher" %>
<%@ page import ="com.easyattendance.model.Student" %>

<%@page import="com.easyattendance.services.AssignmentSubmissionService"%>
<%@page import="com.easyattendance.services.AddClassService"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Subjectwise Assignment Submission Report</title>
<!-- <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> -->
<jsp:include page="../includeFiles.jsp" />

<!-- Export Links -->
<script type="text/javascript" src="<%=request.getContextPath()%>/public/js/export/tableExport.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/public/js/export/jquery.base64.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/public/js/export/html2canvas.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/public/js/export/jspdf/libs/sprintf.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/public/js/export/jspdf/jspdf.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/public/js/export/jspdf/libs/base64.js"></script>
	
<!-- fooTable Links -->
<link href="../css/footable.core.css" rel="stylesheet" type="text/css" />
<link href="../css/footable.metro.css" rel="stylesheet" type="text/css" />
<script src="<%=request.getContextPath()%>/public/js/footable.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/public/js/footable.sort.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function () {
		$('.footable').footable();
	});
</script>

<!-- ***************************************** -->
</head>

<body class="left-sidebar">

<!-- Session check : user logged in or not/ press back button -->
<jsp:include page="../common/checkSession.jsp" />
<%-- <jsp:include page="../common/checkTeacherRole.jsp" /> --%>

<%
	List<Integer> stud_assList=(List<Integer>)session.getAttribute("stud_assList");
	List<Student> stud_List=(List<Student>)session.getAttribute("stud_List");
	String class_id=(String)session.getAttribute("class_id"); 
	String subject_name=(String)session.getAttribute("subject_name");
	Integer no_of_assignments=(Integer)session.getAttribute("no_of_assignments");
	DateFormat dateFormat=new SimpleDateFormat("dd-MM-YYYY");
	Date date=new Date();

	String sys_dt=dateFormat.format(date);
%>

	<!-- Wrapper -->
	<div id="wrapper">

		<!-- Content -->
		<div id="content">
			<div id="content-inner">
				<div>
					<center><label><h2>Subjectwise Assignment Submission Report</h2></label></center>
					<br><label>Date : <%=sys_dt %></label>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<label>Class Id : <%=class_id %></label>
					<br><label>Subject : <%=subject_name %></label>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<label>Total No of assignments given : <%=no_of_assignments %></label>
				</div>
				
	 <form name="viewSubjectwiseSubmissionStatus" action="" class="gridview">  
		
		<table name="subjectwiseReport" id="tbl_subjectwise_report" class="footable metro-attendance">
                <thead>
                <tr>
                    <th data-toggle="true" data-sort-initial="true">
                        Roll No.
                    </th>
                    <th data-toggle="true">
                        Student Name
                    </th>
                    <th data-hide="phone,tablet" data-sort-ignore="true">
                        Last Name
                    </th>  
                    <th data-toggle="true" data-sort-ignore="true">
                        No. of Assignments Submitted
                    </th>
                </tr>
                </thead>
              <tbody>
              
        <% int counter=0; %>
		<% for(int i = 0; i < stud_assList.size(); i++) { %>
		<tr>
		
			<td data-value="<%= stud_List.get(i).getStud_roll_no() %>">
					<%=stud_List.get(i).getStud_roll_no() %>
			</td>
			
			 <td data-value="<%=stud_List.get(i).getStud_fname() %>">
					<%=stud_List.get(i).getStud_fname().toUpperCase().toString()%>
			</td>
			
			<td>
					<%=stud_List.get(i).getStud_lname().toUpperCase().toString() %>
			</td> 
			<td>
					<%=stud_assList.get(i) %>
			</td> 
		</TR>
	
		<% } %>
	
	 </tbody>
   </table>
   			
		</form>
	<br><br>	
	<table>
		<tr>
		<td><a href="#" onClick ="$('#tbl_subjectwise_report').tableExport({type:'csv',escape:'false'});"> <img src='<%=request.getContextPath()%>/public/images/csv.png'> CSV</a></td>
		<td><a href="#" onClick ="$('#tbl_subjectwise_report').tableExport({type:'txt',escape:'false'});"> <img src='<%=request.getContextPath()%>/public/images/txt.png'> TXT</a></td>
		<td><a href="#" onClick ="$('#tbl_subjectwise_report').tableExport({type:'excel',escape:'false'});"> <img src='<%=request.getContextPath()%>/public/images/xls.png'> XLS</a></td>
		<td><a href="#" onClick ="$('#tbl_subjectwise_report').tableExport({type:'doc',escape:'false'});"> <img src='<%=request.getContextPath()%>/public/images/word.png'> Word</a></td>
	<%-- 	<td><a href="#" onClick ="$('#tbl_subjectwise_report').tableExport({type:'powerpoint',escape:'false'});"> <img src='<%=request.getContextPath()%>/public/images/ppt.png'> PowerPoint</a></td> --%>
		<td><a href="#" onClick ="$('#tbl_subjectwise_report').tableExport({type:'png',escape:'false'});"> <img src='<%=request.getContextPath()%>/public/images/png.png'> PNG</a></td>
		<td><a href="#" onClick ="$('#tbl_subjectwise_report').tableExport({type:'pdf',pdfFontSize:11,pdfLeftMargin:20,escape:'false'});"> <img src='<%=request.getContextPath()%>/public/images/pdf.png'> PDF</a></td>
		</tr>
	</table>
		
	</div>
  </div>
 </div>
  
		<!-- Sidebar -->
		<div id="sidebar">

			<!-- Sidebar Header - Logo & Name -->
			<jsp:include page="../common/sidebarHeader.jsp" />

			<jsp:include page="teacherMenu.jsp" />

			<!-- Sidebar Footer Content -->
			<jsp:include page="../common/sidebarFooter.jsp" />

		</div>

	</div>	
	<script type="text/javascript">
		$(function(){
			$("#displaySubjectwiseAssignmentReport").addClass("current_page_item");
		});
	</script>
</body>
</html>